﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Example06.aspx.cs" Inherits="Chapter05.Example06" %>

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>代码清单 5-6 使用局部变量和全局变量</title>
</head>
<body>
    <form>
        <div>
            <script type="text/javascript">
                var myGlobalVar = "apples";

                function myFunc(name) {
                    var myLocalVar = "sunny";
                    return ("Hello " + name + ". Today is " + myLocalVar + ".");
                };
                document.writeln(myFunc("Adam"));
            </script>
            <script type="text/javascript">
                document.writeln("I like " + myGlobalVar);
            </script>
        </div>
    </form>
</body>
</html>
